package nullby.omnia.activity.card;

import nullby.common.utils.CustomLog;
import nullby.omnia.R;
import nullby.omnia.db.DatabaseHelper;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;

import com.actionbarsherlock.app.SherlockFragmentActivity;

public class ActivityAddCard extends SherlockFragmentActivity implements
		OnClickListener {
	public static final String TAG = ActivityAddCard.class.getSimpleName();

	private EditText etAddWord;
	private EditText etAddTrans;
	private EditText etAddPerevod;
	private EditText etAddExPerevod;
	private EditText etAddExOriginal;
	private Button bAddCardComplete;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		CustomLog.logI(TAG, "onCreate");
		super.onCreate(savedInstanceState);

		initView();
	}

	protected void initView() {
		CustomLog.logI(TAG, "initView");
		setContentView(R.layout.activity_add_card);

		bAddCardComplete = (Button) findViewById(R.id.bAddCardComplete);
		etAddWord = (EditText) findViewById(R.id.etAddWord);
		etAddTrans = (EditText) findViewById(R.id.etAddTrans);
		etAddPerevod = (EditText) findViewById(R.id.etAddPerevod);
		etAddExPerevod = (EditText) findViewById(R.id.etAddExPerevod);
		etAddExOriginal = (EditText) findViewById(R.id.etAddExOriginal);
		bAddCardComplete.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		CustomLog.logI(TAG, "onClick");
		Integer id = v.getId();
		if (id == R.id.bAddCardComplete) {
			Integer idWord = 1;
			DatabaseHelper.get().insertWord(1, "", "", "", "", "", "");
			finish();
		}
	}
}
